<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>层次选择器</title>
    <script type="text/javascript"src="../js/jquery-3.3.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //后代选择器，获取并设置#menu内所有的<span>元素的背景颜色
            $("#menu span").css("background-color","yellow")
        })
    </script>
</head>
<body>
      <div id="menu">
          <h2>水果分类</h2>
          <dl>
              <dt>新疆羊肉串<span>特价</span></dt>
              <dd>新疆羊肉串拥有...</dd>
          </dl>
          <dl>
              <dt>海南椰子<span>促销</span></dt>
              <dd>海南椰子拥有...</dd>
          </dl>
          <span>更多更多。。。。</span>
      </div>
</body>
</html>